home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
windows
/
pmcstex.zip
/
CSTEX_.E
next >
Wrap
Text File
|
1996-06-08
|
41KB
|
963 lines
/**************************************************************************
This is CSTeX for EPM, version 8.6.1996 (but no change from 28.5.1996)
Written by Petr Mikulík, mikulik@physics.muni.cz
Address: Dept. of Solid State Physics, Masaryk University,
Kotlarska 2, Brno, Czech Republic
Package location: http://www.sci.muni.cz/~mikulik/os2.html
This macro file pmCSTeX.e (together with pm4epm.e) implements CSTeX menu
for various (La)TeX related commands.
This package was intended to be the (final?) replacement for CSTeX, EPMTeX,
TeXshell and pmgraf (and emacs perhaps?) under OS/2.
*Must have* for TeX under OS/2 :-)
Installation:
1. Copy this file and pm4epm.e to any directory on your EPMPATH
(create directory E:\APPS\EPM\CSTeX, copy all files into it, modify
EPMPATH=...;E:\APPS\EPM\CSTeX;... in your CONFIG.SYS)
2. Write these lines into your Profile.erx:
'link pm4epm'
'link pmcstex'
'link czech' -- this is for Czech users: Czech keyboard implementation by Z. Wagner
'link sampactn' -- there is syntax highlighting there
'link MyCNF' -- there are your actions there
3. Add these two lines into actions.lst file:
CSTeX
pm4epm
4. Maybe something more, thus:
5. *** Please read manual pmCSTeX.INF ***
Compilation (of *.e to *.ex files):
You must have received file stdconst.e from EPMMAC.ZIP (it can be found
on hobbes.nmsu.edu:os2/editors). Then type
etpm pm4epm
etpm cstex
This package is free, but you can modify it only for your purposes and
you have to keep the original on a safe place. You must distribute this
package free of charge. If you make small changes here (you introduce a new
menu for your printer etc.), then keep the filename. Otherwise rename this
file. If you find bugs, or you find something missing, or you want to send
me your codes to put it in, you are welcome.
Otherwise, if you think this package saves you $40, then send me $20,
so you gain $20! :-)) At least send me happy email if you happy using this
package.
***************************************************************************/
include 'stdconst.e' -- from EPMMAC.ZIP
-- include 'pm4epm.e' -- Routines are used, but include not needed
/*** define CSTeX hotkeys ***/
def S_F11 = 'cstex_texit_background S'
def S_F12 = 'cstex_next_error S'
DEFINIT
universal pm4epm_MasterNotFound,
cstex_error_array_id, cstex_error_index, cstex_errorarray_name,
cstex_no_more_errors,
cstex_true_tex_background, cstex_background_beep
cstex_error_index=-1
cstex_no_more_errors=0
cstex_true_tex_background=1 -- background compilation is: 0=window 1=icon
cstex_background_beep=0 -- 0/1 nobeep/beep after background texing
'PostMe BuildCSTeXMenu'
/*
DEFLOAD
-- 'a_togl_hilit S'
-- 'toggle_parse 1 epmkwds.tex'
Syntax hilighting is now discussed in the manual pmCSTeX.INF.
Toggling the syntax on has been moved to your local config file, i.e. MyCNF.e
Lines with --PMTOGGLE are no more needed, but for historical reasons
they are still here
*/
const
-- CSTEX_CSTEX = 1 -- allow Czech (CSTeX distribution) related features
CSTEX_CSTEX = 0 -- disable Czech (CSTeX distribution) related features
-- enables/disables CSTOCS, CSTeX spell checker, dvi-out etc.
CSTEX_CS2CS = 1 -- use cs2cs program for Czech to Czech conversion
-- CSTEX_CS2CS = 0 -- use old DOS program
const
cstex_texit_inf = 'Compile document by (La)TeX (pm_command_cmd %format.cmd %N)'
cstex_preview_inf = 'Preview document by dvipm (using dvipm.cnf)'
cstex_paragraph_inf = 'Run LaTeX over current paragraph'
cstex_dvips_inf = 'Run dvi-out and dvips'
cstex_master_inf = 'Load Master file'
cstex_include_inf = 'Load the file under cursor'
cstex_refresh_inf = 'Refresh current file (reload from disk)'
cstex_save_all_inf = 'Save all files in the ring'
cstex_highlight_all_inf = 'Toggle syntax highlighting for the whole ring'
cstex_texit_background_inf = '(La)TeX the document on background'
cstex_next_error_inf = 'Locate next error in .log file (and open .log if necessary)'
DEFC cstex_actionlist
universal ActionsList_FileID
insertline 'cstex_texit'cstex_texit_inf'CSTeX',ActionsList_FileID.last+1,ActionsList_FileID
insertline 'cstex_preview'cstex_preview_inf'CSTeX',ActionsList_FileID.last+1,ActionsList_FileID
insertline 'cstex_paragraph'cstex_paragraph_inf'CSTeX',ActionsList_FileID.last+1,ActionsList_FileID
insertline 'cstex_dvips'cstex_dvips_inf'CSTeX',ActionsList_FileID.last+1,ActionsList_FileID
insertline 'cstex_master'cstex_master_inf'CSTeX',ActionsList_FileID.last+1,ActionsList_FileID
insertline 'cstex_include'cstex_include_inf'CSTeX',ActionsList_FileID.last+1,ActionsList_FileID
insertline 'cstex_refresh'cstex_refresh_inf'CSTeX',ActionsList_FileID.last+1,ActionsList_FileID
insertline 'cstex_save_all'cstex_save_all_inf'CSTeX',ActionsList_FileID.last+1,ActionsList_FileID
insertline 'cstex_texit_background'cstex_texit_background_inf'CSTeX',ActionsList_FileID.last+1,ActionsList_FileID
insertline 'cstex_next_error'cstex_next_error_inf'CSTeX',ActionsList_FileID.last+1,ActionsList_FileID
insertline 'cstex_highlight_all'cstex_highlight_all_inf'CSTeX',ActionsList_FileID.last+1,ActionsList_FileID
const
COMPILE IF CSTEX_CSTEX=1
csindex='csIndex'
csbibtex='csBibTeX'
COMPILE ELSE
csindex='Index'
csbibtex='BibTeX'
COMPILE ENDIF
--------------------- KEYS DEFINITION ---------------------------------
-- CTRL/3 \begin{} \end{} LaTeX environment
def C_3 =
--x=winmessagebox('Choose environment','i=itemize' ,65535)
/* -- This comes from my Turbo Vision pmgraf program
s=',flush~left,~center,flush~right,eqnarray,~equation,array,~tabular,table,tabbing,'
s=s'e~numerate,~itemize,~description,displaymath,~picture,~figure,~verbatim,document'
*/
s=',array,center,description,displaymath,document,enumerate,eqnarray,equation,figure,flushleft,flushright,itemize,picture,tabbing,table,tabular,verbatim'
s=listbox('environment',s,,20,22,17,25) -- pos1,pos2,height,width
-- s=entry_box('environment',s,'equation',30,30)
if s='' then return; endif
if .col>1 then .line=.line+1; endif
s=word(s,1)
insertline '\begin{'s'}'
insertline ''
insertline '\end{'s'}'
.line=.line-2
.col=1
-- CTRL/4 AMSLaTeX environments
def C_4 =
s=',align,align*,aligntat,alignat*,bmatrix,cases,gather,gather*,matrix,multline,multline*,pmatrix,smallmatrix,split,subequations,Sb,Sp,vmatrix,Vmatrix,xalignat,xlignat*,xxalignat,xxlignat*'
s=listbox('AMSLaTeX env.',s,,20,22,23,25) -- pos1,pos2,height,width
-- s=entry_box('environment',s,'equation',30,30)
if s='' then return; endif
if .col>1 then .line=.line+1; endif
s=word(s,1)
insertline '\begin{'s'}'
insertline ''
insertline '\end{'s'}'
.line=.line-2
.col=1
-- CTRL/5 LATeX font sizes
def C_5 =
s=',tiny,scriptsize,footnotesize,smalle,normalsize,large,Large,LARGE,huge,Huge'
s=listbox('font size',s,,20,22,10,25) -- pos1,pos2,height,width
if s='' then return; endif
getline x; replaceline( insertstr('\'s,x,.col-1) )
.col=.col+1+length(s)
-- Alt-G defines Greek keyboard. Keyboard layout according to Chi-writer
def A_G =
keys pm_GreekKeys
DEFKEYS pm_OrigKeys
DEFKEYS pm_GreekKeys
def 'a'-'t','x'-'z','G','D','E','S','L','X','P','S','F','O','J' = pm_TypeGreek()
DEFPROC pm_TypeGreek()
universal czech_is
a=lastkey(0)
GreekAlphabet='\alpha\beta\chi\delta\epsilon\phi\gamma\eta\iota\psi\kappa\lambda\mu\nu\omega\pi\theta\rho\sigma\tau\\\upsilon\ksi\upsilon\zeta\'
a=asc(a);
if a>90 then i=a-96; else i=a-64; endif
p=1; j=2
while j<=i do p=pos('\',GreekAlphabet,p+1); j=j+1; endwhile
i=pos('\',GreekAlphabet,p+1);
if a>90
then s=substr(GreekAlphabet,p,i-p)
else s=upcase(substr(GreekAlphabet,p+1,1)); s='\'s''substr(GreekAlphabet,p+2,i-p-2)
endif
getline x; replaceline( insertstr(s,x,.col-1) )
.col=.col+length(s)
-- load the keyset as before. If Czech.E is used, then czech_is holds the state
if czech_is=1 then keys czech_keys
elseif